/*
 * Register dumps of VGA modes.
 *
 * Taken (and reworked) from public domain source:
 *	 http://my.execpc.com/~geezer/osd/graphics/modes.c
 */

#include <delirium.h>
#include "vga.h"


/* Linear 1 bit */
struct vga_regs		vgaregs_640x480x2 = {

	0xE3,		/* Misc graphics register */

	/* Sequencer registers */
	{ 0x03, 0x01, 0x0F, 0x00, 0x06 },

	/* CRT Controller registers */
	{ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E,
	  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0xEA, 0x0C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3,
	  0xFF },

	/* Graphics Controller registers */
	{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F,
	  0xFF },

	/* Attribute / palette controller registers */
	{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
	  0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
	  0x01, 0x00, 0x0F, 0x00, 0x00 }
};

struct vga_regs		vgaregs_320x200x256_modex = {

	0x63,		/* Misc graphics register */

	/* Sequencer registers */
	{ 0x03, 0x01, 0x0F, 0x00, 0x06 },

	/* CRT Controller registers */
	{ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F,
	  0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0x9C, 0x0E, 0x8F, 0x28, 0x00, 0x96, 0xB9, 0xE3,
	  0xFF },

	/* Graphics Controller registers */
	{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
	  0xFF },

	/* Attribute / palette controller registers */
	{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
	  0x41, 0x00, 0x0F, 0x00, 0x00 }
};

struct vga_regs		vgaregs_320x200x256 = {

	// MGR
	0x63,

	// Sequencer
	{ 0x03, 0x01, 0x0F, 0x00, 0x0E },

	// CRT Controller
	{ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F,
	  0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0x9C, 0x0E, 0x8F, 0x28, 0x40, 0x96, 0xB9, 0xA3,
	  0xFF },

	// Graphics Controller
	{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
	  0xFF },

	// Attribute/palette controller
	{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
	  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
	  0x41, 0x00, 0x0F, 0x00, 0x00 }
};



struct vga_regs		vgaregs_640x480x16 = {

	0xE3,		/* Misc graphics register */

	{ 0x03, 0x01, 0x08, 0x00, 0x06 },

	/* CRT Controller registers */
	{ 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E,
	  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	  0xEA, 0x0C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3,
	  0xFF },

	/* Graphics Controller registers */
	{ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x05, 0x0F,
	  0xFF },

	/* Attribute / palette controller registers */
	{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
	  0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
	  0x01, 0x00, 0x0F, 0x00, 0x00 }
};
